#!/usr/bin/env node

const fs = require('fs')
const path = require('path')


const buildJSPath = path.resolve(__dirname, 'html', 'build.js')

const buildJS = fs.readFileSync(buildJSPath).toString()

const scriptBuild = `<script type="application/javascript">
${buildJS}
</script>`

const htmlPath = path.resolve(__dirname, 'html', 'index.html')
const htmlCode = fs.readFileSync(htmlPath).toString()
const htmlFinal = `
${htmlCode}

${scriptBuild}
`


const htmlJS = `
export default \`${htmlFinal}\`
`

const htmlJSPATH = path.resolve(__dirname, 'html', 'index.html.js')
fs.writeFileSync(htmlJSPATH, htmlJS)
